UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yAgdnLyKUqyFg7vs9zucaLIiitJJgCIp9AIoSJjqC1U='
WHERE
key_id = 'e6ce56ec5110516bad2e024fc1d184ce37b7b863f3fe9d88738afd8fec631a69'
AND (
token = 'yAgdnLyKUqyFg7vs9zucaLIiitJJgCIp9AIoSJjqC1U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)