UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MWQHaPeJnSDh8B2eYn2e6NEuOnmPkrqogkCaELfzcHo='
WHERE
key_id = '36ba31ac272035f4c7ab16bf703e17d4539b7a2935387eb9c5ebc3e9e4a99c36'
AND (
token = 'MWQHaPeJnSDh8B2eYn2e6NEuOnmPkrqogkCaELfzcHo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)