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