UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0JNCOIFALt9eKD/wj9v5fc+58ZzSGEjoSjwkKEu+gKU='
WHERE
key_id = '086bb3649b2a1bfb85b84d97a44c537472207759b3493b1924ab04a9e001bf8a'
AND (
token = '0JNCOIFALt9eKD/wj9v5fc+58ZzSGEjoSjwkKEu+gKU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)