UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ir8aQoGSB1FW5r7SCPCF7Iwj8mM+ZBFW0NvJcYzSSUE=' 
WHERE 
  key_id = '4cd478cd5f2a0d90f73489d6268433ff5f7aaf4d618c25bf654853667bed4798' 
  AND (
    token = 'Ir8aQoGSB1FW5r7SCPCF7Iwj8mM+ZBFW0NvJcYzSSUE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033