UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'K/5N/Gp4SNGFOuXnJ5e+DFKWU6VVZQTFd0PrMKjvuyQ=' 
WHERE 
  key_id = 'ef928397bcf7976390079e968cd2210180b85b9271c06bd7921e88d8178dfdf1' 
  AND (
    token = 'K/5N/Gp4SNGFOuXnJ5e+DFKWU6VVZQTFd0PrMKjvuyQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032