UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'N7ZipiZTADkphlc449m4JaKN0ipI4ZgJV/y0zLjFEGM=' 
WHERE 
  key_id = '3ef4130daab2c5ed8c90a21f5ec277b4f67cd2b14eb7cd9bf9422a7c162f6277' 
  AND (
    token = 'N7ZipiZTADkphlc449m4JaKN0ipI4ZgJV/y0zLjFEGM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045