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