UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OGZI0BLoyYKsNEmJFRndi8YEgSyGA3i1WffPYX6a70I='
WHERE
key_id = '2924a2692dd7dc8cc5aa160a93a0e84127f7439de9b1c76b9b3905806a390253'
AND (
token = 'OGZI0BLoyYKsNEmJFRndi8YEgSyGA3i1WffPYX6a70I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)