UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kT19O6KHg8SXWHdGecGptPH9IVd4n0syfQ+zrQWwe9s='
WHERE
key_id = 'fd0caef46f629ff4d3560c8a47b4123d8ee08a417ab055e8383f187681a53c57'
AND (
token = 'kT19O6KHg8SXWHdGecGptPH9IVd4n0syfQ+zrQWwe9s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)