UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IafxgTPM7J1/secbQTbpBuyqHetoFVQu1RTDSiKxgbY='
WHERE
key_id = 'c323c8d6ee37e05493a2d55cc5f225968e1db3a022ab9e1519bf0dda28c68b23'
AND (
token = 'IafxgTPM7J1/secbQTbpBuyqHetoFVQu1RTDSiKxgbY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)