UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fLCt7ulb/KjrWElQsWeeGw61467G2Y5NI/nmJY14034=' 
WHERE 
  key_id = 'c68b4bffce9c8fed7cc9bc8e6a398dada8c4bc68c38b1b8357e53d45cb58302e' 
  AND (
    token = 'fLCt7ulb/KjrWElQsWeeGw61467G2Y5NI/nmJY14034=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024