UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bpSZGFquJ/NrxhS8vcVjwlg5TLKtF2r1ejKPz9KOeqo='
WHERE
key_id = '2c2cb6161782dd8b08c243eb383430342bf705f13ec4e852370c2632f2ebf729'
AND (
token = 'bpSZGFquJ/NrxhS8vcVjwlg5TLKtF2r1ejKPz9KOeqo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)