UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aULILKE89okfCTSuoBlbxHgaeIuoPG01ONOvsXyXoDM='
WHERE
key_id = 'bba952a0b8bae00a98e8a146ed0251047507578619d01b01f9ba47e83c67a8e5'
AND (
token = 'aULILKE89okfCTSuoBlbxHgaeIuoPG01ONOvsXyXoDM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)