UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hLPydWwqQhzaWgPcIP9VAQo/YLLMzLD9Kvu7j+rNLV0='
WHERE
key_id = 'd125580a44ae672f36136238eeba9583e9a26695488342497e3bf2fbaaee593c'
AND (
token = 'hLPydWwqQhzaWgPcIP9VAQo/YLLMzLD9Kvu7j+rNLV0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)