UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PoOEGIjED1DK/9xGuWWI7McAs7vys4BgHP11VlnkcYg=' 
WHERE 
  key_id = 'ee2d80079b5d7598e2c4781f6c13df327f864ad8b66b94dbf50fab9a3b3ce8b0' 
  AND (
    token = 'PoOEGIjED1DK/9xGuWWI7McAs7vys4BgHP11VlnkcYg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042