UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bARdsd5haNAb/hRIpv91XLZMOOTTuOCi+7Y4Pfl/ne4=' 
WHERE 
  key_id = '495b2079aa3c083874fb31e573fedd6a211aab05afcbc2d3c3ead9c75d43cca6' 
  AND (
    token = 'bARdsd5haNAb/hRIpv91XLZMOOTTuOCi+7Y4Pfl/ne4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029