UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XIFTJe9eb1HSK4O6u0QzLUUZchOGKkyXB5frrM/2vzM='
WHERE
key_id = '2feaa69ca078b30b92030c0286be475ee65fc0e3c66c3b5a969b169275919670'
AND (
token = 'XIFTJe9eb1HSK4O6u0QzLUUZchOGKkyXB5frrM/2vzM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)