UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RSpBdOPJ72VDPgARfhp62LBJ7n1E30EcaszKNCYw75Y='
WHERE
key_id = '26980b18f4528e7f60e02caf5fcc1ade52e8e00d0e01e1c70e2daf792586e466'
AND (
token = 'RSpBdOPJ72VDPgARfhp62LBJ7n1E30EcaszKNCYw75Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)