UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8uTyrERc5pH+UQPa24q7UEHJ28KKp/j3PrHALK52BCA='
WHERE
key_id = 'b3a4225a7e20916eeb3caed8649876f11fdc8be2c1ec57584b6a14ac9891df1c'
AND (
token = '8uTyrERc5pH+UQPa24q7UEHJ28KKp/j3PrHALK52BCA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)