UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1xQMdrFJFiPROXAp2Sv/hCyxbSawiL0qBusL9pD0OEw='
WHERE
key_id = '09172cb07c095518e6af1b5b4e9a341588480e92fb5d842f222822f843b77ac7'
AND (
token = '1xQMdrFJFiPROXAp2Sv/hCyxbSawiL0qBusL9pD0OEw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)