UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9Uy5eOeo5m27eZ/qKLOwSYjjlbBBdvfBaybDGWO4abk='
WHERE
key_id = 'b910b0869506c6719a3ce059c45b1fcd60a53e64249854ba7850cfc80a9e7768'
AND (
token = '9Uy5eOeo5m27eZ/qKLOwSYjjlbBBdvfBaybDGWO4abk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)