UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GUUaKtJNE6Jq1cZuMw0KJlG5XcOCbQIccD6dH13iBtQ=' 
WHERE 
  key_id = '2eac30ee2e28525aa3a05f0bbdaada96bfff35d0ec2a39909df9404a7d06cf70' 
  AND (
    token = 'GUUaKtJNE6Jq1cZuMw0KJlG5XcOCbQIccD6dH13iBtQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033