UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v5CL3ARMo8vbAifz2sNYyvOvQUur1buqNolk/sT+01Q='
WHERE
key_id = 'bbd57451be156affd06c4ed680f6a6db63b1dad8fd23b6da12fe77bcc5981e79'
AND (
token = 'v5CL3ARMo8vbAifz2sNYyvOvQUur1buqNolk/sT+01Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)