UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8ouhcCkGXQGHZO3pao2yT+0CQDRD5dQi2gaQAa/WWdU='
WHERE
key_id = 'eaaabfc97e86afee15019f5facd1df83e840243e4b0bc65a25a2b089a646bf23'
AND (
token = '8ouhcCkGXQGHZO3pao2yT+0CQDRD5dQi2gaQAa/WWdU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)