UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eTWli8VFoK26MpJ/ZxZiaBVoxlj6q2zge3BhWC2FYSs='
WHERE
key_id = 'a05212042b8eb67c276ec1bca164410c6832e7425ff7aac272287a0fd0788a1a'
AND (
token = 'eTWli8VFoK26MpJ/ZxZiaBVoxlj6q2zge3BhWC2FYSs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)