UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'E/xUTcaNfUdKb23dR4vJBZcgHlXmlbq0ugrtzb6Z44c=' 
WHERE 
  key_id = '521752083b2afb9715b0cb3a27ff3969e93092e96b292acb25ac8100ebccc26d' 
  AND (
    token = 'E/xUTcaNfUdKb23dR4vJBZcgHlXmlbq0ugrtzb6Z44c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028