UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '25jNcm18chlH4gt1NccZhF6JogtPzvAJUZOQSfgmZwg='
WHERE
key_id = '5fc5f76b5cc6aee74dca34c8e321efb10845cfd581b55305d1f1cf3908b96341'
AND (
token = '25jNcm18chlH4gt1NccZhF6JogtPzvAJUZOQSfgmZwg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)