UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JrNg07Y65qLwxAn3PoEZBTCsK2V6VyvybyGbEuLyjvY='
WHERE
key_id = '05add8ef2a00bf277e25a4d0cac3fa2ca94fdcd0682b43e6b60d8fc28aa9492e'
AND (
token = 'JrNg07Y65qLwxAn3PoEZBTCsK2V6VyvybyGbEuLyjvY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)