UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yQOgGgDRft6zcPnCjlOmHjO6hJV9XB5jfVwurknQA10='
WHERE
key_id = '37ccf2e4b3c9ec516bc09486eb4b13bea4c604bbf62d834e92f0b151e331fab8'
AND (
token = 'yQOgGgDRft6zcPnCjlOmHjO6hJV9XB5jfVwurknQA10='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)