UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5BOsynv4H+ZeU8ciFMchym1645AIUD2n5ezmBfSgWJ4='
WHERE
key_id = '940ce523363a19db5f3ae2094af5a876d971c6743a11073c31ee802634951d33'
AND (
token = '5BOsynv4H+ZeU8ciFMchym1645AIUD2n5ezmBfSgWJ4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)