UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xc5UIZE+F05UbSCwKZJlSUx/2QaOuEoqeI3XwSCiC6M='
WHERE
key_id = 'f2b50a2f6e89cafb51fc75ee7b306017ebffd3bc7a63c652f50e7b0a79076815'
AND (
token = 'xc5UIZE+F05UbSCwKZJlSUx/2QaOuEoqeI3XwSCiC6M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)