UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8USn9lfoVIwm59B97XSlMmRJUH36rikAxSpXyYo0pi8=' 
WHERE 
  key_id = 'afdc676b111c22fd54fe8af2ac26f6cabcd8db040cc815ad9c30658d4fbe4af0' 
  AND (
    token = '8USn9lfoVIwm59B97XSlMmRJUH36rikAxSpXyYo0pi8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039