UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OEf/I7sZX3tyV3fm9U9Rkc3eB+mAuTdGwMQLwsruf6M='
WHERE
key_id = '9a0a441092b6a392db8924fc845a201d8a69d60a7f6a2ed2680d7a360ee6e70a'
AND (
token = 'OEf/I7sZX3tyV3fm9U9Rkc3eB+mAuTdGwMQLwsruf6M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)